package com.example;
import java.time.LocalDateTime;

public class Order {
    private String orderId;
    private String username;
    private Screening screening;
    private int row;
    private int seat;
    private double amount;
    private LocalDateTime orderTime;
    private boolean isRefunded;
    private LocalDateTime refundTime;
    private double refundAmount;

    public Order(String orderId, String username, Screening screening, int row, int seat, double amount, LocalDateTime orderTime) {
        this.orderId = orderId;
        this.username = username;
        this.screening = screening;
        this.row = row;
        this.seat = seat;
        this.amount = amount;
        this.orderTime = orderTime;
        this.isRefunded = false;
    }

    public String getOrderId() {
        return orderId;
    }

    public Screening getScreening() {
        return screening;
    }

    public int getRow() {
        return row;
    }

    public int getSeat() {
        return seat;
    }

    public double getAmount() {
        return amount;
    }

    public LocalDateTime getOrderTime() {
        return orderTime;
    }

    public boolean isRefunded() {
        return isRefunded;
    }

    public LocalDateTime getRefundTime() {
        return refundTime;
    }

    public String getUsername() {
        return username;
    }

    public double getRefundAmount() {
        return refundAmount;
    }

    public void refund(double refundAmount) {
        this.isRefunded = true;
        this.refundTime = LocalDateTime.now();
        this.refundAmount = refundAmount;
    }

    public void setRefunded(boolean refunded) {
        isRefunded = refunded;
    }

    public void setRefundTime(LocalDateTime refundTime) {
        this.refundTime = refundTime;
    }

    public void setRefundAmount(double refundAmount) {
        this.refundAmount = refundAmount;
    }

}